/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package protocolHandler;

/**
 *
 * @author Александр Емельянов (mr.lex91@gmail.com)
 */
public class HeaderCodes {
    public static int getResponseHeaderCode(String header)
    {
        if (header.equalsIgnoreCase("AccExists")) return 1;
        else if (header.equalsIgnoreCase("AccNotExists")) return 2;
        else if (header.equalsIgnoreCase("LogInErr")) return 3;
        else if (header.equalsIgnoreCase("LogOutServerInit")) return 4;
        else if (header.equalsIgnoreCase("Message")) return 5;
        else if (header.equalsIgnoreCase("MsgFrom")) return 6;
        else if (header.equalsIgnoreCase("Info")) return 7;
        else if (header.equalsIgnoreCase("Roster")) return 8;
        else if (header.equalsIgnoreCase("ErrConnectParams")) return 9;
        else if (header.equalsIgnoreCase("SucCreateAcc")) return 10;
        else if (header.equalsIgnoreCase("SucDeleteAcc")) return 11;
        else if (header.equalsIgnoreCase("SucLogIn")) return 12;
        else if (header.equalsIgnoreCase("ConnectParams")) return 13;
        else if (header.equalsIgnoreCase("ConnectionClosed")) return 14;
        else if (header.equalsIgnoreCase("UserOnLine")) return 15;
        else if (header.equalsIgnoreCase("UserOffLine")) return 16;
        else if (header.equalsIgnoreCase("AccAlreadyAuth")) return 17;
        else if (header.equalsIgnoreCase("ReceiveFile")) return 18;
        else if (header.equalsIgnoreCase("InetInfo")) return 19;
        return 0;
    }
    public static int getRequestHeaderCode(String header)
    {
        if (header.equalsIgnoreCase("CreateAcc")) return 1;
        else if (header.equalsIgnoreCase("DeleteAcc")) return 2;
        else if (header.equalsIgnoreCase("LogIn")) return 3;
        else if (header.equalsIgnoreCase("LogOut")) return 4;
        else if (header.equalsIgnoreCase("Send")) return 5;
        else if (header.equalsIgnoreCase("SendTo")) return 6;
        else if (header.equalsIgnoreCase("GetInfo")) return 7;
        else if (header.equalsIgnoreCase("GetRoster")) return 8;
        else if (header.equalsIgnoreCase("ConnectParams")) return 9;
        else if (header.equalsIgnoreCase("SendFile")) return 10;
        else if (header.equalsIgnoreCase("InetInfo")) return 11;
        return 0;
    }
}
